f = open("第二周_第二节tmp.py", "w", encoding="utf-8")
f.write('''teacher_1 = "老师"\n''')
f.write('''said_1 = "说:"\n''')
#CRUD三明治
f.write('''teacher_1 +=said_1\nprint(teacher_1)\nteacher_1 = "老师"\n''')
f.write('''print(teacher_1+said_1+"好好学，奥利给！！！")\n''')
f.write('''conment = teacher_1+said_1+"好好学，奥利给！！！"\n ''')
f.write('''
print(len(conment))
print(conment.find('师'))
print(conment.index('奥利给'))
print(conment.startswith('你'))
print(conment.endswith('!'))
print(conment[-6:])
print(conment.replace('老师说','我说'))
show_1 = conment.split(':')
print(show_1[1])
print(':'.join(show_1))
print(conment.strip('老！'))
print(conment.replace('：','--'))
''')
#格式化输出
f.write('''
print("{}!{}!{}!{}!{}!".format('我','要','好','好','学'))
print('{teacher_2}{said_2}'.format(said_2='我看好你',teacher_2='图南老师说'))
print('打乒乓球总是{0}{1}{0}{1}'.format('乒','乓'))
print(f'{teacher_1}{said_1}')
print('{:.0009}'.format(520.1314))
''')
f.close()